#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <time.h>
#include <stdlib.h>

void BubbleSort(int* arr, int n)
{
	for (int i = 0; i < n - 1; i++)
	{
		for (int j = 0; j < n - i - 1; j++)
		{
			if (arr[j] > arr[j + 1])
			{
				int tmp = arr[j];
				arr[j] = arr[j + 1];
				arr[j + 1] = tmp;
			}
		}
	}
}

int main()
{
	int n = 10000;
	int* arr = (int*)malloc(sizeof(int) * n);
	if (arr == NULL)
	{
		perror("malloc");
		return 1;
	}

	for (int i = 0; i < n; i++)
	{
		arr[i] = 100;
	}
	int start = clock();
	BubbleSort(arr, n);
	int end = clock();

	printf("time:%d\n", start);
	printf("time:%d\n", end);
	printf("time:%d\n", end - start);

	return 0;
}
